In the LZ77 encoding (for example, ZIP and GZIP), search for the longest matching string is executed using a sliding window, and the address and the string length are assigned to a compression code. For example, in the case of GZIP, comparison for whether each string to be compressed matches any string in a sliding window is made using a bigram hash table and a linked list. Related art examples are disclosed in Japanese Laid-open Patent Publication No. 05-252049, Japanese Patent No. 3038233, Japanese Laid-open Patent Publication No. 10-261969, and Japanese Laid-open Patent Publication No. 04-274557.